let arr=input_arr[0].split(' ')
let word_length=parseInt(arr[0])
let pad_char=arr[1]
let msg=input_arr[1]
if(word_length<=msg.length){
    let submsg=msg.substring(msg.length-word_length,msg.length)
    console.log(submsg)
}
else{
    let padstr=pad_char.repeat(word_length-msg.length)
    console.log(padstr+msg)
}